<?php

namespace App\Http\Resources\Mp;

use Illuminate\Http\Resources\Json\JsonResource;

class UserResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'name' => $this->name,
            'morning_rule' => $this->morning_rule,
            'lunch_rule' => $this->lunch_rule,
            'dinner_rule' => $this->dinner_rule,
            'can_breakfast'=> $this->role->can_breakfast,
            'can_lunch' => $this->role->can_lunch,
            'can_dinner'=> $this->role->can_dinner,
            'phone'=> $this->phone,
            'role_name'=> $this->role->name,
            'school'=> $this->school->name
        ];
    }
}
